<%@page import="Entity.Programme"%>
<%@page import="java.util.ArrayList"%>
<%@page import="DAO.Dao_Programme"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Web Directory</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" type="text/css" href="mycss/list.css" />
<link href="mycss/gh-buttons.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="stylecss/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="./myjs/jquery-1.3.1.min.js"></script>
<script type="text/javascript" src="./myjs/jquery.tablesorter.js"></script>
<%-- <script type="text/javascript" src="./myjs/jquery.tablesorter.pager.js"></script> --%>
<%
	Dao_Programme dao = new Dao_Programme();
	ArrayList<Programme> ds = dao.getProgram();
%>
</head>
<style type="text/css">
.top {
	border: 0px solid #ccc;
	overflow: hidden;
	padding: 0;
	margin: 0;
	padding-bottom: 2px;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
}

.top-left {
	border: 0px solid #ccc;
	font: bold 14px Arial, Verdana, Helvetica, sans-serif;
	float: left;
	padding: 5px 0;
}

.top-right {
	border: 0px solid #ccc;
	float: right;
	text-align: right;
}

.details1 {
	overflow: hidden;
}

.content-left {
	float: left;
	padding-right: 20px;
	border: 0px solid #ccc;
}

.content-right {
	float: right;
	border: 0px solid #ccc;
}

.frm .field {
	display: table;
	margin: 5px;
}

.frm div label {
	width: 150px;
	word-wrap: break-word;
	display: table-cell;
	vertical-align: middle;
	position: static;
}

.frm textarea {
	width: 260px;
	height: 80px;
}

.frm input[type="text"],input[type="password"] {
	width: 260px;
}

.lstcbb {
	width: 260px;
	height: 95px;
	overflow-y: auto;
	border: 1px solid #ccc;
	background-color: #fff;
	display: auto;
}
</style>
<body>
	<%@include file="header.jsp"%>
	<!--End #header-->

	<div id="content" align="center">
		<div id="mainContainer">
			<div class="box">
				<div id="container-orglst">
					<div id="tab5" class="tabContents details4">
						<h1>Programme List</h1>
						<div class="top">
							<div class="top-left filter">
								<s:url action="showAllProgramme" var="aURL" />
								<s:a href="%{aURL}">All</s:a>
								|
								<s:url action="showDefaultList.action" var="aURL" />
								<s:a href="%{aURL}">0-9</s:a>
								|
								<s:url action="searchListProgrammeByLetterFromAToE.action"
									var="aURL" />
								<s:a href="%{aURL}">A B C D E</s:a>
								|
								<s:url action="searchListProgrammeByLetterFromFToJ.action"
									var="aURL" />
								<s:a href="%{aURL}">F G H I J</s:a>
								|
								<s:url action="searchListProgrammeByLetterFromKToN.action"
									var="aURL" />
								<s:a href="%{aURL}">K L M N</s:a>
								|
								<s:url action="searchListProgrammeByLetterFromOToR.action"
									var="aURL" />
								<s:a href="%{aURL}">O P Q R</s:a>
								|
								<s:url action="searchListProgrammeByLetterFromSToV.action"
									var="aURL" />
								<s:a href="%{aURL}">S T U V</s:a>
								|
								<s:url action="searchListProgrammeByLetterFromWToZ.action"
									var="aURL" />
								<s:a href="%{aURL}">W X Y Z</s:a>
							</div>
							<div class="top-right include"
								style="width: 500px; display: inline; margin-bottom: 10px; padding: 0">
								<!--<input type="button" name="btCreate" value="Create" onclick= "location.href='detail.html'">-->
								<div id="checkActive">
									<form action="checkbox" id="FormIncludeInActive"
										method="post">
										<a href="creatPrograme.jsp" class="button icon approve"><font
									color="black">Create </font> </a>
										<s:checkbox name="includeInActive" id="includeInActive"
											onclick="FormIncludeInActive.submit();"
											label="Include In-Active">Include In-Active
										</s:checkbox>
									</form>
								</div>

							</div>
						</div>
						<div class="clear"></div>
						<script type="text/javascript">
				function  openDetails(name) {
											document.location='showDetailProgramme.action?name='+name;
											
							}
				function  showConfirmationAndOpenDetails(name) {
					if (confirm('Do you want to set active for this programme?')) { 
						document.location='convertActive.action?name='+name;
						}
											
											
										}
									</script>
						<div class="div-table" style="border: none;">
							<div class="table-list" style="height: 450px;">
								<table id="sizeOptions" width="100%">
									<thead>
										<tr>
											<th>Name</th>
											<th>Desception</th>
											<th>Contact</th>
											<th>Active</th>
										</tr>
									</thead>
									<tbody>

										<s:iterator value="prlist">
											<tr class="odd">
												<%-- 								<td><s:url action="showDetailProgramme" var="urlTag"> --%>
												<%-- 										<s:param name="name" value="name" /> --%>
												<%-- 									</s:url> <s:a href="%{urlTag}"> --%>
												<%-- 										<s:property value="name" /> --%>
												<%-- 									</s:a></td> --%>
												<td><s:set name="active" value="active" /> <s:set
														name="name" value="name" /> <a href="#"
													onclick="<s:if
										test="%{#active==false}">openDetails('${name}');</s:if> <s:else>openDetails('${name}');</s:else>">${name}</a>
												</td>
												<td><s:property value="des" /></td>
												<td><s:property value="contact" /></td>
												<td><s:set name="active" value="active" /> <s:if
														test="%{#active==false}">No</s:if> <s:else>Yes</s:else>
												</td>
											</tr>
										</s:iterator>


									</tbody>
								</table>
							</div>
							<p />

							<span class="pagelinks"> <a href="#"><img
									src="firstpage.PNG" title="First Page" alt="First Page" /> </a> <a
								href="#"><img src="prevpage.PNG" title="Prev Page"
									alt="Prev Page" /> </a> Page <input
								style="font-size: 12px; width: 35px; padding: 4px;"
								class="curpage" type="text" name="b" value="1" /> of <span
								class="nops">1</span> <a href="#"><img src="nextpage.PNG"
									title="Next Page" alt="Next Page" /> </a> <a href="#"><img
									src="lastpage.PNG" title="Last Page" alt="Last Page" /> </a> </span>
						</div>
						<!-- end of content right -->

						<div class="cleaner_with_height">&nbsp;</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<%@include file="footer.jsp"%>
	<script language="javascript" type="text/javascript">
		$(document).ready(function() {
			$("#sizeOptions").tablesorter({
				widthFixed : true,
				widgets : [ 'zebra' ]
			}).tablesorterPager({
				container : $("#pager")
			});
		});

		$('#sizeOptions tr').mouseover(function() {
			$(this).addClass("hover");
		});

		$('#sizeOptions tr').mouseout(function() {
			$(this).removeClass("hover");
		});
	</script>
</body>
</html>
